﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.ComponentModel;

namespace BusinessLogic
{
    [DataContract]
    public class User : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        private UserInfo _user;

        public User()
        {
        }

        public User(UserInfo user)
        {
            _user = user;
        }

        [DataMember]
        public string Login
        {
            get { return _user.Login; }
            set
            {
                _user.Login = value;
                OnPropertyChanged("Login");
            }
        }

        protected void OnPropertyChanged(string propValue)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propValue));
            }
        }
    }
}
